package com.xq.service.impl;

import com.xq.mapper.PeopleMapper;
import com.xq.pojo.People;
import com.xq.service.PeopleService;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xq
 * @version 1.0
 * @date 2021/4/6 22:29
 * @description 人们业务服务接口实现层
 */
@Service // 注入到Ioc容器，标识这是一个业务服务层对象
public class PeopleServiceImpl implements PeopleService {

    // 注入到Ioc容器的对象
    @Autowired
    private PeopleMapper peopleMapper;

    @Override
    public int addPeople(People p) {
        return this.peopleMapper.addPeople(p);
    }

    @Override
    public int addPeopleSelective(People p) {
        return this.peopleMapper.addPeopleSelective(p);
    }

    @Override
    public int updatePeopleByIdSelective(People p) {
        return this.peopleMapper.updatePeopleByIdSelective(p);
    }

    @Override
    public int updatePeopleById(People p) {
        return this.peopleMapper.updatePeopleById(p);
    }

    @Override
    public int deletePeopleById(Integer id) {
        return this.peopleMapper.deletePeopleById(id);
    }

    @Override
    public People getPeopleById(Integer id) {
        return this.peopleMapper.getPeopleById(id);
    }

    @Override
    public List<People> getPeopleAll() {
        return this.peopleMapper.getPeopleAll();
    }
}
